package jeconbond.experiment.market.generate;

import jeconbond.automata.INode;
import jeconbond.automata.AutomataUtils.IProfitCostGenManager;
import jeconbond.economic.resources.IResourceType;
import jeconbond.economic.resources.ResourceBasket;
import jeconbond.economic.resources.ResourceUtils;
import jeconbond.experiment.market.resourcerelations.process.IResourceRelationExperimentContext;

public class DefaultProfCostManager implements IProfitCostGenManager {
	private static final int COST_SIZE = 4;
	
	public int costSize = COST_SIZE;
	private IResourceRelationExperimentContext context;

	public DefaultProfCostManager(IResourceRelationExperimentContext context) {
		this.context = context;
	}

	@Override
	public ResourceBasket[] generateCosts() {
		ResourceBasket[] result = ResourceUtils.randomBaskets(
				context.getExperimentSettings().resources,
				context.getRandom(),
				(int) (costSize * (1.0 / 3.0)), 
				costSize
		);
		return result;
	}
	
	@Override
	public ResourceBasket[] generateProfit() {
		return ResourceUtils.randomBaskets(
				context.getExperimentSettings().resources,
				context.getRandom(),
				1, 
				1
		);
	}

	@Override
	public double addRandomCost(INode[] automatas, IResourceType resource) {
		return 0.0;
	}

	@Override
	public double addRandomProfit(INode[] automatas, IResourceType resource) {
		return 0.0;
	}

	@Override
	public void onBranchCompleted() { }
}
